rust-analyzer subtree update#157251
Conversation
…tocol Instead of recreating it.
Example
---
```rust
fn foo() {
let foo = Ok(1);
return foo.unwrap_$0or(2);
}
```
**Before this PR**
```rust
fn foo() {
let foo = Ok(1);
return foo.unwrap_or_else(|| 2);
}
```
**After this PR**
```rust
fn foo() {
let foo = Ok(1);
return foo.unwrap_or_else(|e| 2);
}
```
minor: sync from downstream
…yumu Less conjuration magic
The most important reason is incrementality. While not a lot of things depend on the stability of `EnumVariantId`, it's still useful to have them stable. However it turns out that many things actually do want the name, more than those that want the index.
`ThinVec` doesn't allocate when empty.
Previously module ID reuse was based on order of creation solely. Now we store the parent module and name, and so Salsa will reuse the ID for modules that have the same name and parent. This is important as many interned IDs contain modules, so if the module is invalidated they too are.
Example
---
```rust
struct Foo(&'static str);
impl Foo {
fn text(&self) -> &str { self.0 }
}
fn main() {
let s = Foo("");
$0print!("{}{}", s, s);$0
let _ = s.text() == "";
}
```
**Before this PR**
```rust
fn $0fun_name(s: &Foo) {
*print!("{}{}", s, s);
}
```
**After this PR**
```rust
fn $0fun_name(s: &Foo) {
print!("{}{}", *s, *s);
}
```
---
```rust
macro_rules! refmut { ($e:expr) => { &mut $e }; }
fn foo() {
let mut n = 1;
$0let v = refmut!(n);
*v += 1;$0
let k = n;
}
```
**Before this PR**
```rust
fn $0fun_name(n: &mut i32) {
let v = refmut!(n);
*v += 1;
}
```
**After this PR**
```rust
fn $0fun_name(n: &mut i32) {
let v = refmut!(*n);
*v += 1;
}
```
minor: Replace `cfg-if` with `std::cfg_select`
…ge-pat-e0029 feat: add diagnostic for E0029
Encode the name instead of index in `EnumVariantId`
…-exhaustive-record-pat feat: add diagnostic for E0638
Signed-off-by: Kai Tanaka <275430420+quyentonndbs@users.noreply.github.com>
…ords-in-stdx-and-ide-comments fix: duplicated words in stdx/assert.rs and ide/inject.rs doc-comments
`request.rs` was passing `binary_target = true` for TargetKind::Bin, Example, and Test, but not for Bench, so a `fn main()` in `benches/foo.rs` (typical with `harness = false`) was suppressed by `should_skip_runnable` in the annotations layer. Mirror `target_spec.rs:255` by including Bench in both the code-lens config check and `should_skip_target`. Closes rust-lang/rust-analyzer#21948. Signed-off-by: Onyeka Obi <softwareengineerasaservant@isurvivable.cv>
perf: Provide access to `RootDatabase`'s `LineIndex` for the proc macro protocol
fix: show Run lens for fn main in bench targets
Show `const` in the signature help if applicable
…se_path_seg Fix assit `qualify_path` loses path segment
fix: handle usages in macro for extract_function
Previously, adding newline between statements was often redundant
Example
---
```rust
fn main() {
let bar = Some(true);
bar.$0
other();
}
```
**Before this PR**
```rust
fn main() {
let bar = Some(true);
let Some(${1:bar}) = bar else {
$2
};
$0
other();
}
```
**After this PR**
```rust
fn main() {
let bar = Some(true);
let Some(${1:bar}) = bar else {
$2
};$0
other();
}
```
Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
…kkno Enable salsa feature for syntax-bridge
fix: Try to improve completion ranking
Kill proc-macro-srv processes on shutdown
fix: use add deref in assign instead add `&mut` for value
|
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer |
|
|
|
@bors r+ p=1 |
`rust-analyzer` subtree update Subtree update of `rust-analyzer` to rust-lang/rust-analyzer@123c166. Created using https://github.com/rust-lang/josh-sync. r? @ghost
|
💔 I suspect this PR failed tests as part of a rollup After fixing the problem, consider running a try job for the failed job before re-approving. |
|
This pull request was unapproved. This PR was contained in a rollup (#157261), which was unapproved. |
|
Do you have any tips for reproducing this? |
|
Almost certainly caused by my last rust-analyzer PR. It may be necessary to add |
|
Yup, sounds like that, I just hoped to have a way to test it locally. |
|
How about |
|
|
Hmmm that's weird, because that is the command the CI is running when it fails afaik |
|
I just tried |
|
Which bootstrap.toml config profile are you both on? |
|
The tools one, but I managed to reproduce it after setting up the profile and |
Subtree update of
rust-analyzerto rust-lang/rust-analyzer@123c166.Created using https://github.com/rust-lang/josh-sync.
r? @ghost